<link rel="stylesheet" type="text/css" href="<?php echo $this->_baseUrl;?>/public/css/user.css"/>      
<script>
$(document).ready(function(){

$("a.tab").click(function () {
$(".active").removeClass("active");
$(this).addClass("active");
$(".content").slideUp();
var content_show = $(this).attr("name");
$("#"+content_show).slideDown();
});

hash = window.location.hash;
if(hash != ""){
	$(".active").removeClass("active");
	$(hash).addClass("active");
	$(".content").slideUp();
	var content_show = $(hash).attr("name");
	$("#"+content_show).slideDown();
}
});
</script>
<script type="text/javascript" src="<?php echo $this->_baseUrl;?>/public/js/jquery.validate.min.js"></script>
<script type="text/javascript">
     $().ready(function() {		
          $("#formInf").validate({
				rules: {
					    name:"required"
						},
				
              messages: {
				
				        name: "Bạn chưa nhập họ tên"
				
						}
				
					});
         $("#formChangepass").validate({
				
						rules: {
				
							old_password: {
				
								required: true,
				
								minlength: 6
				
							},
				
							password: {
				
								required: true,
				
								minlength: 6
				
							},
				
							repassword: {
				
								required: true,
				
								equalTo: "#password"
				
							}
						},
				
						messages: {
				
							old_password: {
				
								required: "Bạn chưa nhập mật khẩu cũ.",
				
								minlength: "Mật khẩu cũ tối thiểu 6 kí tự."
				
							},
				
							password: {
				
								required: "Bạn chưa nhập mật khẩu mới.",
				
								minlength: "Mật khẩu mới tối thiểu 6 kí tự."
				
							},
				
							repassword: {
				
								required: "Bạn chưa xác nhận mật khẩu mới.",
				
								equalTo: "Mật khẩu không khớp."
				
							}
								
						}
				
					});
				
				});		
</script>
<div id="tabbed_box_account">
<div class="tabbed_area_account">

<ul class="tabs_account">
<li><a href="#infomation"  name="infomation_content" id="infomation" class="tab active">Thông tin</a></li>
<li><a href="#changepass"  name="changepass_content" id="changepass" class="tab">Đổi mật khẩu</a></li>
</ul>

<div style="display: block;" id="infomation_content" class="content">

    <form id="formInf" action="<?php echo $this->_baseUrl;?>/user/account#infomation" method="post">
               <?php
                  if($this->status == 1)
                  {
               ?>
               <div style="margin-left:100px;color:#FF0000;width:400px;font-weight:bold;">
              	         <img src="<?php echo $this->_baseUrl;?>/public/images/web/error.png" width="32" height="32" style="float:left; margin-right:10px;"/>
                       	 <div>Cập nhật thất bại</div>
               </div>
                <?php  
                 }
                   elseif($this->status == 2)
                     { 
                ?>
               <div style="margin-left:100px;color:#00F;width:400px;font-weight:bold;">
                         <img src="<?php echo $this->_baseUrl;?>/public/images/web/success.png" width="32" height="32" style="float:left; margin-right:10px;"/>
                         <div>Cập nhật thành công</div>
               </div>
               <?php }
               ?>
                            
        <p> 
           <label for="username">Tên đăng nhập</label> 
           <input type="text" id="disable" name="username" disabled="disabled"  value="<?php echo $this->username;?>" /> 
        </p> 
        <p> 
           <label for="email">Email</label> 
           <input id="disable" name="email" type="text"  disabled="disabled" value="<?php echo $this->email;?>"/> 
        </p> 
       
        <p> 
           <label for="credit">Tài khoản</label> 
           <input id="disable" name="credit" type="text" disabled="disabled" value="<?php echo $this->credit;?> VND" /> 
       </p>
        <p> 
           <label for="name">Họ và tên</label> 
           <input id="name" name="name" type="text" maxlength="50"value="<?php echo $this->fullname;?>" /> 
       </p>
       <p class="submit"> 
           <button class="button" id="updateInf" name="updateInf" type="submit">Cập nhật</button>
           <button class="button" id="resetInf" name="resetInf" type="reset">Hủy</button>  
       </p> 
    </form> 
                   

</div>

<div style="display: none;" id="changepass_content" class="content">

    <form id="formChangepass" action="<?php echo $this->_baseUrl;?>/user/account#changepass" method="post">
               <?php 
               if($this->status == 3)
               {
               ?>
               <div style="margin-left:100px;color:#FF0000;width:400px;font-weight:bold;">
              	         <img src="<?php echo $this->_baseUrl;?>/public/images/web/error.png" width="32" height="32" style="float:left; margin-right:10px;"/>
                       	 <div>Mật khẩu cũ sai</div>
               </div>
               <?php 
               }
               elseif($this->status == 4)
               {
               ?>
               <div style="margin-left:100px;color:#FF0000;width:400px;font-weight:bold;">
              	         <img src="<?php echo $this->_baseUrl;?>/public/images/web/error.png" width="32" height="32" style="float:left; margin-right:10px;"/>
                       	 <div>Đổi mật khẩu thất bại</div>
               </div>
               <?php
               }
               elseif($this->status == 5)
               {
               ?>
               <div style="margin-left:100px;color:#00F;width:400px;font-weight:bold;">
                         <img src="<?php echo $this->_baseUrl;?>/public/images/web/success.png" width="32" height="32" style="float:left; margin-right:10px;"/>
                         <div>Đổi mật khẩu thành công</div>
               </div>
               <?php
               }
               ?>
          
       <p> 
           <label for="old_password">Mật khẩu cũ</label> 
           <input id="old_password" name="old_password" type="password" maxlength="30" /> 
       </p>                  
        <p> 
           <label for="password">Mật khẩu mới</label> 
           <input id="password" name="password" type="password" maxlength="30" /> 
        </p> 
        <p> 
           <label for="repassword">Nhập lại mật khẩu mới</label> 
           <input id="repassword" name="repassword" type="password" maxlength="30" />  
        </p> 
       
       <p class="submit"> 
           <button class="button" id="changepass" name="changepass" type="submit">Cập nhật</button>
           <button class="button" id="resetChangepass" name="resetChangepass" type="reset">Hủy</button>  
       </p> 
    </form> 
                   
</div>

</div>
</div>